#include "Organ.h"


Organ::Organ(void)
{
}


Organ::~Organ(void)
{
}

Organ::Organ(Position position, double radius)
{
	this->position.setX(position.getX());
	this->position.setY(position.getY());
	this->radius = radius;
}

void Organ::setInfested()
{
	this->infested = 1;
}

void Organ::addInfestedPoint()
{
	if(this->infested>=100)
		return;
	this->infested += infestedSpeed;
	if(this->infested>=100)
		this->infested = 100;
}

void Organ::setInfestedSpeed(const double speed)
{
	this->infestedSpeed = speed;
}

void Organ::cureFlu(const double curePoint)
{
	this->infested-=curePoint;
	if(this->infested<=0)
		this->infested = 0;
}

double Organ::getInfestedPoint()
{
	return this->infested;
}

bool Organ::isInfested()
{
	return this->infested>0?true:false;
}

bool Organ::isExist(Position position)
{
	if(sqrt(pow(this->position.getX()-position.getX(),2)+pow(this->position.getY()-position.getY(),2)))
		return false;
	return true;
}